package com.itbaizhan.service.impl;

import com.itbaizhan.dao.UserDao;
import com.itbaizhan.dao.impl.UsersDaoImpl;
import com.itbaizhan.pojo.Users;
import com.itbaizhan.service.UsersService;

import java.util.List;

public class UsersServiceImpl implements UsersService {
    @Override
    public Users findUsersById(int userid) {
        UserDao ud = new UsersDaoImpl();

        return ud.selectUserById(userid);
    }

    @Override
    public int modifyUserById(Users users) {
        UserDao ud  = new UsersDaoImpl();
        return ud.updateUserById(users);

    }

    @Override
    public List<Users> findUsersByLikeName(String username) {
        UserDao ud = new UsersDaoImpl();
        return ud.selectUserByLikeName(username);
    }

    @Override
    public Users findUsers(int userid) {
        UserDao ud = new UsersDaoImpl();
        return ud.selectUsers(userid);
    }
}
